-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for generating Swift SDKs for Ubuntu 24.04 Noble #188
Add support for generating Swift SDKs for Ubuntu 24.04 Noble #188
Conversation
- This depends on xz being available on the host
- Each distribution and supported versions has a single line.
IIRC problem with xz was that it required additional tooling installed on macOS, and at least documentation updated here in |
Yep, looks like |
Yes, providing a command to install from I'd also prefer the generator to fall back to the currently support archive format if xz is not installed. |
That can be done! And then when we are interacting with the Debian mirrors, I guess we could just throw if xz is not installed and show that it is required for creating a Swift SDK for Debian. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, just a logging nit so that users are informed about this subtlety
Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Download.swift
Outdated
Show resolved
Hide resolved
- In the future it may be required for Debian, but for now it is optional.
Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Download.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Download.swift
Outdated
Show resolved
Hide resolved
- Seems like the environment needed to be passed to the which() method.
c57e698
to
3b853b3
Compare
@swift-ci test |
…ts (#193) Apparently I didn't test very well from PR #188, because when I went to use the Ubuntu Noble Swift SDK, I got this error: ``` error: link command failed with exit code 1 (use -v to see invocation) ld.lld: error: ~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64.artifactbundle/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk/usr/lib/aarch64-linux-gnu/libm.so:4: cannot find /lib/aarch64-linux-gnu/libm.so.6 inside ~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk >>> GROUP ( /lib/aarch64-linux-gnu/libm.so.6 AS_NEEDED ( /lib/aarch64-linux-gnu/libmvec.so.1 ) ) >>> ^ clang: error: linker command failed with exit code 1 (use -v to see invocation) ld.lld: error: ~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64.artifactbundle/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk/usr/lib/aarch64-linux-gnu/libm.so:4: cannot find /lib/aarch64-linux-gnu/libm.so.6 inside /~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64.artifactbundle/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk >>> GROUP ( /lib/aarch64-linux-gnu/libm.so.6 AS_NEEDED ( /lib/aarch64-linux-gnu/libmvec.so.1 ) ) >>> ^ ``` Turns out, the packages for Ubuntu Noble do not come with a lib/ symlink included, so all I needed was to add a custom step to create that symlink from `ubuntu-noble.sdk/lib` -> `ubuntu-noble.sdk/usr/lib` and all is well. As a part of these changes, I also added a missing cleanup of the target toolchain to remove unused parts of the LinuxRecipe as is done for the [WebAssemblyRecipe](https://github.com/swiftlang/swift-sdk-generator/blob/a0ff972af294243ef9211534f7c9ba6f83672b82/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift#L120-L125). Doing this reduces the size of `ubuntu-noble.sdk` from 1GB to 721MB, when building the Swift SDK without docker. This can help for the end-to-end tests, and is nice to have for smaller Swift SDK distributions. Finally, I updated the EndToEndTests to provide `linuxDistributionVersion` and set the Swift60_Ubuntu tests to use "24.04" as a way to test this lib/ directory fix. This has me thinking we may want to think about end-to-end tests for each version of Ubuntu, like "20.04", "22.04", and "24.04", for each version of Swift.
I was working on adding Debian 12 support for #116, but realized that adding Ubuntu Noble is "low-hanging fruit", since it's very straightforward. The default is still Ubuntu 22.04 Jammy, but this adds the option of generating the Swift SDK for 24.04 Noble now.
I have also changed the packages download to get
Packages.xz
instead ofPackages.gz
since it is a smaller file download. I wonder if it is okay to usexz
here since I noticed that the directories on the Debian mirrors only havePackages.xz
files available, unlike the Ubuntu mirrors which all havePackages.gz
ANDPackages.xz
files available.@MaxDesiatov @euanh